Skip to content

chore: fix JavaScript lint errors (issue #11559)#11571

Merged
kgryte merged 1 commit intostdlib-js:developfrom
mvanhorn:osc/11559-fix-lint-errors
Apr 19, 2026
Merged

chore: fix JavaScript lint errors (issue #11559)#11571
kgryte merged 1 commit intostdlib-js:developfrom
mvanhorn:osc/11559-fix-lint-errors

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Resolves #11559.

Description

What is the purpose of this pull request?

This pull request:

  • Fixes the three stdlib/no-new-array lint errors that stdlib-bot flagged in the 2026-04-19 daily JavaScript lint workflow run: lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/test/test.js:64,138,164.
  • Replaces each out = new Array( len/8 ); for (...) out[i] = 0; pattern inside the Mock( len ) helpers with out = []; for (...) out.push( 0 );. Same final array (zero-filled, length len/8), same downstream property assignments (out.byteLength, out.slice). Only the allocation strategy changes.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

grep -n "new Array" lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/test/test.js returns no matches after the change.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance.

This PR was generated with Claude Code, which applied the three identical stdlib/no-new-array refactors verbatim after the author confirmed each code section matched the pattern flagged by the bot-filed issue.


@stdlib-js/reviewers

Replace three `new Array( len/8 )` + zero-fill-loop patterns with an
empty array-literal plus `push` loop in
`lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/test/test.js`
to satisfy the `stdlib/no-new-array` rule. The Mock() helpers produce
identical output; only the allocation strategy changes.

Resolves stdlib-js#11559
@mvanhorn mvanhorn requested a review from a team April 19, 2026 06:19
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Apr 19, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
assert/has-sharedarraybuffer-support $\color{green}133/133$
$\color{green}+100.00%$
$\color{red}11/12$
$\color{green}+91.67%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}133/133$
$\color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 5 and removed Needs Review A pull request which needs code review. labels Apr 19, 2026
@kgryte kgryte merged commit a2f6be5 into stdlib-js:develop Apr 19, 2026
85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Good First PR A pull request resolving a Good First Issue. review: 5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants